<template>
  <div>
    <van-nav-bar title="学习日历" left-arrow @click-left="back" />
    <div>
      <Calender
        :firstDay="7"
        :courseDate="courseDate"
        @onCurDate="onCurDate"
        @onChangeDate="onChangeDate"
        @onClickDay="onClickDay"
      />
    </div>
  </div>
</template>

<script>
import Calender from "../../components/Index/Calender";
export default {
  name: "",
  data() {
    return {
      courseDate: [],
      courseList: [],
      curDate: ""
    };
  },
  props: [],
  components: {
    Calender
  },
  mounted() {
    document.body.style.background = "#fff";
  },
  methods: {
    back() {
      this.$router.go(-1);
    },
    onCurDate(date) {
      this.requestCourseDate(date);
      this.requestCourse(date);
      this.changeCurDate(date);
    },
    onChangeDate(date) {
      this.requestCourseDate(date);
      this.courseList = [];
      this.changeCurDate(date);
    },
    onClickDay(date) {
      this.requestCourse(date);
      this.changeCurDate(date);
    },
    changeCurDate(date){
        const ary=date.split('-')
        this.curDate=ary[1]+'月'+ary[2]+'日'
    },
    requestCourseDate(date){

    },
    requestCourse(date){
        date=date.replace(/-/g,'/')
        const timestamp=parseInt(new Date(date).getTime()/1000)
    }
  }
};
</script>

<style scoped>
</style>